package com.dflc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dflc.entity.po.TFileAttachmentData;
import com.dflc.entity.vo.TAudioDataVo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 附件信息表 Mapper 接口
 * </p>
 *
 * @author mybatis-gc
 * @since 2024-04-03
 */
@Mapper
public interface TFileAttachmentDataMapper extends BaseMapper<TFileAttachmentData> {

    List<TFileAttachmentData> findAllByMap(Map<String, Object> params);
    List<TAudioDataVo> findAllByMap2(Map<String, Object> params);

    /**
     * 根据业务类型和业务id查询文件
     *
     * @param businessType 业务类型
     * @param businessId   业务id
     * @return
     * @author oyt
     * @date 2025/07/20
     */
    List<TAudioDataVo> findByBusinessTypeAndBusinessId(Integer businessType, Integer businessId);

    void clearObsUrlByMap(Map<String, Object> paramsMap);

    void logicRemoveById(Map<String, Object> paramsMap);

    /**
     * 根据文件ID更新文件业务类型和业务id，传入的业务类型和业务id可以为空
     *
     * @param businessType 业务类型
     * @param businessId   业务id
     * @param fileIds      文件id
     * @return
     * @author oyt
     * @date 2025/07/20
     */
    int updateBusinessTypeAndIdById(Integer businessType, Integer businessId, List<Integer> fileIds);

    /**
     * 根据业务类型，业务ID，页面提交的ID列表，查询需要删除的文件
     *
     * @param businessType
     * @param businessId
     * @param fileIds
     * @return
     * @author oyt
     * @date 2025/07/20
     */
    List<TFileAttachmentData> selectByIdNotIn(Integer businessType, Integer businessId, List<Integer> fileIds);
}
